import java.io.File;
import java.io.IOException;

public class FileDemo3 {
    public static void main(String[] args) throws IOException, InterruptedException {
        File file = new File("./test.txt");
        System.out.println(file.exists());
        System.out.println(file.createNewFile());
        System.out.println(file.exists());

        Thread.sleep(3000);
        file.deleteOnExit();
        System.out.println(file.exists());
    }
}
